package Thread;

import java.util.HashMap;

public class Demo41 {
    private static int sum = 0;
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i <= 100; i++) {
                    sum += i;
                }
            }
        };
        Thread thread = new Thread(runnable);
        thread.start();
        thread.join();
        System.out.println(sum);
    }
}
